package com.bailan.mapper;

import com.bailan.pojo.Admin;
import com.bailan.pojo.DAO.PeopleManagerDAO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author BaiLan
 * @since 2022:05:24
 */
@Mapper
public interface AdminMapper extends BaseMapper<Admin> {


    @Select("SELECT \n" +
            "t.T_id AS account,\n" +
            "t.T_name AS name,\n" +
            "c.C_name AS className,\n" +
            "t.T_sex AS sex,\n" +
            "t.T_age AS age,\n" +
            "t.T_address AS address\n" +
            "FROM class c JOIN teacher t ON c.T_id=t.T_id")
    List<PeopleManagerDAO> getTeacher();


    @Select("SELECT\n" +
            "s.S_id AS account,\n" +
            "s.S_name AS name,\n" +
            "c.C_name AS className,\n" +
            "s.S_sex AS sex,\n" +
            "s.S_age AS age,\n" +
            "s.S_address AS address\n" +
            "FROM student s JOIN class c ON s.C_id=c.C_id")
    List<PeopleManagerDAO> getStudent();

}
